<div class="mui-card-content">
    <form class="mui-input-group">
        <div class="mui-input-row">
            <label>原始密码</label>
            <input type="password" class="mui-input-password" id="password" name="oldpassword">
        </div>
        <div class="mui-input-row">
            <label>新密码</label>
            <input type="password" class="mui-input-password" id="txtPassword" name="password">
        </div>
        <div class="mui-input-row">
            <label>重复新密码</label>
            <input type="password" class="mui-input-password" id="txtPassword1" name="repassword">
        </div>
        <div class="mui-button-row">
            <button type="button" data-loading-text="提交中" data-loading-icon="mui-spinner mui-spinner-custom" class="mui-btn mui-btn-danger" id="update-password">确认修改</button>
        </div>
    </form>
</div>
<script>
    (function ($, doc) {
        //检查 "登录状态/锁屏状态" 结束
        var upButton = doc.getElementById('update-password');
        var oldpassword = doc.getElementById('password');
        var password = doc.getElementById('txtPassword');
        var repassword = doc.getElementById("txtPassword1");
        upButton.addEventListener('tap', function (event) {
            var _self = this;
            mui(_self).button('loading');
            var dataInfo = {
                oldpassword: oldpassword.value,
                password: password.value,
                repassword: repassword.value
            };
            app.uppass(dataInfo, function (err) {
                mui.toast(err);
                mui(_self).button('reset');
            });
        });
    }(mui, document));
</script>